package org.apache.connector.http;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class HttpProcessor {
    private HttpConnector connector;

    public HttpProcessor(HttpConnector connector) {
        this.connector = connector;
    }

    public void process(Socket socket) {
        SocketInputStream is = null;
        OutputStream os = null;
        try {
            is = new SocketInputStream(socket.getInputStream(), 2048);
            os = socket.getOutputStream();
        } catch (IOException e) {
            e.printStackTrace();
        }
        HttpRequest request = new HttpRequest(is);
        HttpResponse response = new HttpResponse(os);
        response.setRequest(request);
        response.setHeader("server", "tomcat6.0");
        parseRequest(is, os);
        parseHeaders(is);

    }

    private void parseRequest(SocketInputStream is, OutputStream os) {

    }

    private void parseHeaders(SocketInputStream is) {

    }
}
